﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace BaffoHat.Core.Test
{
    [TestClass]
    public class GlassTest
    {
        [TestMethod]
        public void Glass_costructor()
        {
            Glass glass = new Glass(DiceFace.One);

            Assert.AreEqual(glass.IsEmpty, true);
            Assert.AreEqual(glass.DiceAssociation, DiceFace.One);
        }

        [TestMethod]
        public void Glass_Fill()
        {
            Glass glass = new Glass(DiceFace.One);
            glass.Fill();

            Assert.AreEqual(glass.IsEmpty, false);
        }

        [TestMethod]
        public void Glass_Empty()
        {
            Glass glass = new Glass(DiceFace.One);

            glass.Fill();
            glass.Empty();
            Assert.AreEqual(glass.IsEmpty, true);
        }

        [TestMethod]
        [ExpectedException(typeof(InvalidOperationException))]
        public void Glass_fill_already_fill()
        {
            Glass glass = new Glass(DiceFace.One);
            glass.Fill();
            glass.Fill();

        }

        [TestMethod]
        [ExpectedException(typeof(InvalidOperationException))]
        public void Glass_empty_already_empty()
        {
            Glass glass = new Glass(DiceFace.One);
            glass.Empty();

        }
    }
}
